#ifndef _ENCODER_SPI_H__
#define _ENCODER_SPI_H__
/* must be include from enc_hw_intf.h */

typedef struct {
	float pwm_duty;
	float pwm_pulse_cnt;
	u32 duty_errors;
	float spi_abi_count;
	u32 spi_abs_count;
	bool b_spi_start_error;
	u32 spi_trans_errors;
	u32 spi_trans_cnt;
	u16 spi_abs_dma_tx_[1];
    u16 spi_abs_dma_rx_[1];
	bool spi_abs_overflow;
	init_pos_callback cb;
	void *ctx;
}enc_spi_t;
extern enc_spi_t enc_spi_;

__STATIC_INLINE float enc_abs_count(void) {
	return enc_spi_.spi_abi_count;
}
#endif /* _ENCODER_SPI_H__ */

